package com.storeapp.entity.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;

import org.hibernate.annotations.Cascade;

@Entity
@Table(name = "store_item")
public class Item {
	private long id;
	private String itemName;
	private String provider;
	private String guarentee;
	private double discount;
	private DealOrder dealOrder;
	private int quantity;
	private double price;
	public Item() {
		super();
	}
	public Item(String itemName, String provider, String guratee, double discount, int quantity, double price) {
		super();
		this.itemName = itemName;
		this.provider = provider;
		this.guarentee = guratee;
		this.discount = discount;
		this.quantity = quantity;
		this.price = price;
	}
	
	@ManyToOne
	public DealOrder getDealOrder() {
		return dealOrder;
	}
	public void setDealOrder(DealOrder dealOrder) {
		this.dealOrder = dealOrder;
	}
	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	@Column(nullable = false)
	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	public String getProvider() {
		return provider;
	}
	public void setProvider(String provider) {
		this.provider = provider;
	}
	public String getGuarentee() {
		return guarentee;
	}
	public void setGuarentee(String guarentee) {
		this.guarentee = guarentee;
	}
	public double getDiscount() {
		return discount;
	}
	public void setDiscount(double discount) {
		this.discount = discount;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
}
